Circuit for color space conversion and associated method

ABSTRACT

A circuit for color space conversion and associated method compresses a portion of an xvYCC color space exceeding an sRGB color space into the sRGB color space via a simplified circuit design when a conversion from the xvYCC color space to the sRGB color space is performed, thereby improving visual effects. The circuit for color space conversion includes a conversion unit converting a pixel signal from the xvYCC color space to the sRGB color space. During the conversion, the conversion unit generates a pixel component on each dimension of the sRGB color space, and compresses the pixel component to output a compressed pixel component when a value of any pixel component is in a compression interval. The compressed pixel component does not exceed a defined range on a corresponding dimension of the sRGB color space.

CROSS REFERENCE TO RELATED PATENT APPLICATIONS

This patent application claims priority from Taiwan Patent ApplicationNo. 098109664, filed in the Taiwan Patent Office on Mar. 25, 2009,entitled “Circuit For Color Space Conversion and Associated Method”, andincorporates the Taiwan patent application in its entirety by reference.

TECHNICAL FIELD

The present disclosure relates to color space conversion, and moreparticularly, to a circuit for color space conversion and a methodthereof.

BACKGROUND

YCbCr and standard RGB (sRGB) color spaces are color space standards. Inpractice, an image device such as a digital camera or a DVD playeroutputs a YCbCr video signal to a display device, e.g., a digitaltelevision (DTV), which then converts the YCbCr video signal to an sRGBformat for display. In the CCIR Recommendation 601 specification, Yrepresenting luminosity, and Cb and Cr representing chromaticity areencoded by 8 bits, where Y has a range of 16 to 235, and Cb as well asCr has a range of 16 to 240. A conversion formula for converting theYCbCr color space to the sRGB color space is described below:

$\begin{bmatrix}R^{\prime} \\G^{\prime} \\B^{\prime}\end{bmatrix} = {\begin{bmatrix}0.00456621 & 0. & 0.00625893 \\0.00456621 & {- 0.00153632} & {- 0.00318811} \\0.00456621 & 0.00791071 & 0.\end{bmatrix} \cdot \left( {\begin{bmatrix}Y_{601}^{\prime} \\C_{B} \\C_{R}\end{bmatrix} - \begin{bmatrix}16 \\128 \\128\end{bmatrix}} \right)}$

A red (R) component, a green (G) component and a blue (B) component,respectively ranging from 0 to 1, range from 0 to 255 when representedby 8 bits.

As visual effect requirements of consumers become higher, the YCbCrcolor space is no longer satisfactory. Therefore, in recent years, anxvYCC (extended video YCC or called x.v.color) color space is developedon the basis of the YCbCr color space. The color range of the xvYCC isabout 1.8 times of that of the YCbCr to provide more colorful display.Within the xvYCC color space, Y, Cb and Cr have enlarged ranges of beingfrom 1 to 254 when encoded by 8 bits. When the enlarged ranges areconverted according to the conversion formula, R, G and B componentshave enlarged ranges of being from −17.46 to 277 as illustrated inFIG. 1. However, portions outside the range of 0 to 255, i.e., −17.46 to0 and 255 to 277, cannot be represented by 8 bits. In the prior art, theportion of −17.46 to 0 is truncated to 0, and the portion of 255 to 277is truncated to 255. Therefore, extensive color ranges of the xvYCCcolor space cannot be displayed in the sRGB color space such that thevisual effect is deteriorated.

SUMMARY

In view of the foregoing issues, one object of the present disclosure isto provide a circuit for color space conversion and a method thereof.The circuit compresses a portion of an xvYCC color space exceeding ansRGB color space into the sRGB color space via a simplified circuitdesign when color space conversion from xvYCC to sRGB is performed,thereby improving visual effect.

A circuit for color space conversion is provided to convert a pixelsignal from a first color space to a second color space with a pluralityof color dimensions. The circuit for color space conversion comprises aconversion unit. The conversion unit generates a plurality of pixelcomponents on the color dimensions and compresses the pixel componentsto output a plurality of compressed pixel components when the pixelcomponents are within a compression interval. The compressed pixelcomponents are within a predetermined range of the dimensions of thesecond color space.

A method for color space conversion is provided. The method comprisesreceiving a pixel signal of a first color space, generating a pluralityof pixel components on a plurality of color dimensions of the secondcolor space for the pixel signal, and compressing the pixel componentsto output a plurality of compressed pixel components when the pixelcomponents are within a compression interval. The compressed pixelcomponents are within a predetermined range on the dimensions of thesecond color space.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic diagram of relative sizes between a YCbCr colorspace and an xvYCC color space.

FIG. 2 is a block diagram of a circuit for color space conversion inaccordance with an embodiment of the present disclosure.

FIG. 3 is a diagram of color space compression in accordance with anembodiment of the present disclosure.

FIG. 4 is a flow chart of a method for color space conversion inaccordance with an embodiment of the present disclosure.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

FIG. 2 is a block diagram of a circuit 20 for color space conversion inaccordance with an embodiment of the present disclosure. The circuit 20comprises a register unit 24 and a conversion unit 23. The circuit 20performs conversion from an xvYCC color space (to be referred to as thexvYCC) to an sRGB color space (to be referred to as the sRGB). Each ofthe three color dimensions, including R, G and B dimensions, of the sRGBhas a defined range with a lower limit value and an upper limit value,which are respectively called a first lower limit value and a firstupper limit value. When represented by 8 bits, the first lower limitvalue and the first upper limit value are 0 and 255 respectively. Whenthe xvYCC is converted to the sRGB, with a lower limit value and anupper limit value, respectively called a second lower limit value and asecond upper limit value, on the R, G and B dimensions, respectively.When represented by 8 bits, the second lower limit value and the secondupper limit value are −17.46 and 277 respectively. The second lowerlimit value is smaller than the first lower limit value, and the secondupper limit value is greater than the first upper limit value.

The register unit 24 comprises a register 21 and a register 22. Theregister 21 stores a first threshold and a first gradient, and theregister 22 stores a second threshold and a second gradient, where thefirst threshold is greater than the second threshold. Parameters storedin the registers 21 and 22 can be adjusted according to userrequirements. A conversion unit 23, coupled to the registers 21 and 22,converts an xvYCC input pixel signal to an sRGB output pixel signalaccording to the parameters stored in the registers 21 and 22. Duringthe conversion, the conversion unit 23 converts the input pixel signalto pixel components, including R, G and B components, of the colordimensions of the sRGB. The conversion unit 23 then determines whether avalue of each pixel component is within a compression interval. If yes,compression is performed; otherwise, compression is not performed. Inother words, the compression interval represents a pixel value intervalwhere compression is performed. In this embodiment, the compressioninterval comprises a pixel value interval having a lower limit value ofthe first threshold and an upper limit value of the second upper limitvalue, and another pixel value interval having a lower limit value ofthe second lower limit value and an upper limit value of the secondthreshold. Therefore, the compression interval can be adjusted bychanging the first or second threshold. When a value of any pixelcomponent, such as the R component for example, is greater than thefirst threshold and not greater than the second upper limit value suchas a limit value on the red dimension of the xvYCC, the conversion unit23 performs a first compression operation to output a first compressedpixel component. Accordingly, the first compressed pixel component isnot higher than the first upper limit value (e.g., a limit value on thered dimension of the sRGB), and the first compressed pixel component hasa linear relationship having the first gradient with the pixelcomponent. When the value of any pixel component is smaller than thesecond threshold and not smaller than the second lower limit value, theconversion unit 23 performs a second compression operation to output asecond compressed pixel component. Accordingly, the second compressedpixel component is not lower than the first lower limit value, and thesecond compressed pixel component has a linear relationship having thesecond gradient with the pixel component. With respect to any pixelcomponent between the first threshold and the second threshold, theconversion unit 23 directly outputs the pixel component withoutcompression. Therefore, for the output pixel signal outputted by theconversion unit 23, the R, G and B components are within the color rangeof the sRGB.

FIG. 3 is a diagram of color space compression in accordance with anembodiment of the present disclosure. An input pixel component is one ofthe R, G and B components converted by the input pixel signal asillustrated in FIG. 2. An output pixel component is one of the R, G andB components comprised in the output pixel signal as illustrated in FIG.2. Referring to FIG. 3, when the input pixel component is greater thanthe first threshold and not greater than the second upper limit value,or is smaller than the second threshold and not smaller than the secondlower limit value, it is compressed to generate the output pixelcomponent. Thus, the pixel components exceeding the sRGB color range canbe compressed into the sRGB color range to be displayed as colors ofvarious levels instead of being processed as a same color level. Forexample, the R component at 260 and 270 exceeding the upper limit value255 shall be displayed as red of different levels after having beenprocessed instead of being regarded as red at 255. FIG. 3 shows twokinds of compression approaches—one is a curve compression and the otheris a linear compression in this embodiment. Preferably, the curvecompression is generated according to a Gamma curve to meet human visualeffect. Alternatively, in the circuit 20 for color space conversionaccording to the present disclosure the linear compression approach isapplied, thereby reducing circuit cost as well as achieving a visualeffect approximating the curve compression.

In this embodiment, a slope between the first threshold and the secondupper limit value represents a first gradient, with which the linearcompression is performed. That is, the first compression operation isperformed according to Formula 1:Output pixel component=(input pixel component−first threshold)×firstgradient+first threshold  (Formula 1)

A slope between the second threshold and the second lower limit valuerepresents a second gradient, with which the linear compression isperformed. That is, the second compression operation is performedaccording to Formula 2:Output pixel component=(input pixel component—second threshold)×secondgradient+second threshold  (Formula 2)

Formula 1 performs linear interpolation between the first threshold andthe second upper limit value, and Formula 2 performs linearinterpolation between the second threshold and the second lower limitvalue. Preferably, the conversion circuit 23 comprises an interpolationcircuit (not shown) for performing the linear interpolation as disclosedby Formulas 1 and 2.

In Formula 1, when the input pixel component and the first compressedpixel component respectively have the second upper limit value and thefirst upper limit value, the first threshold is decided by a designer,and then the first gradient is determined by substituting the firstthreshold, the first upper limit value and the second upper limit valuein Formula 1. Alternatively, the first gradient is decided by thedesigner, the first threshold is determined by substituting the firstgradient, the first upper limit value and the second upper limit valuein Formula 1. Similarly, in Formula 2, when the input pixel componentand the second compressed pixel component respectively have the secondlower limit value and the first lower limit value, the second thresholdis decided by a designer, and then the second gradient is determined bysubstituting the second threshold, the first lower limit value and thesecond lower limit value in Formula 2. Alternatively, the secondgradient is decided by the designer, the second threshold is determinedby substituting the second gradient, the first lower limit value and thesecond lower limit value in Formula 2. Therefore, under suchcircumstances, the register 21 stores either the first threshold or thefirst gradient, and the register 22 stores either the second thresholdor the second gradient, xvYCC color space conversion with improvedvisual effect can be realized by limited hardware.

In another embodiment, the conversion unit 23 comprises a lookup table(not shown) for storing the input pixel component and the correspondingoutput pixel component. When the input pixel component is greater thanthe first threshold and not greater than the second upper limit value,the corresponding output pixel component represents the first compressedpixel component. When the input pixel component is smaller than thesecond threshold and not smaller than the second lower limit value, thecorresponding output pixel component represents the second compressedpixel component. When the input pixel component is between the firstthreshold and the second threshold, the original input pixel componentrepresents the corresponding output pixel component. Accordingly, theconversion unit 23 performs first and second compression operationsaccording to the lookup table.

Preferably, with respect to R, G and B components generated byconverting an xvYCC input pixel signal, the conversion unit 23respectively applies different thresholds and gradients to perform theabovementioned linear compression. The thresholds and gradients arestored in the registers 21 and 22.

For that the xvYCC is supported by the high definition multimediainterface (HDMI) standard starting from HDMI 1.3, the circuit 20 forcolor space conversion according to the present disclosure can beapplied to an HDMI receiver, so as to convert an xvYCC format signalreceived by the HDMI receiver to an sRGB format signal to be displayedon a display device such as a digital TV.

FIG. 4 is a flow chart of a method for color space conversion from afirst color space to a second color space in accordance with anembodiment of the present disclosure. In Step 41, a pixel signal of thefirst color space is received. In Step 42, a pixel component on eachdimension of the second color space is generated from the pixel signalof the first color space. In Step 43, when the pixel component of anydimension is greater than a first threshold and not greater than anupper limit value of the pixel component, a first compression operationis performed to output a first compressed pixel component, which is nothigher than an upper limit value of the dimension in the second colorspace and has a linear relationship having a first gradient with thepixel component. In Step 44, when the pixel component of any dimensionis smaller than a second threshold and not smaller than a lower limitvalue of the pixel component, a second compression is performed tooutput a second compressed pixel component, which is not lower than alower limit value of the dimension in the second color space and has alinear relationship having a second gradient with the pixel component.In Step 45, when the pixel component on any dimension is between thefirst threshold and the second threshold, the pixel component isoutputted directly.

Preferably, the first threshold is greater than the second threshold,the upper limit value of the pixel component on any dimension is greaterthan the upper limit value of the second color space on the dimension,and the lower limit value of the pixel component on any dimension issmaller than the lower limit value of the second color space on thedimension.

Preferably, the first color space is an xvYCC color space and the secondcolor space is an sRGB color space having three color dimensions, i.e.,R, G and B dimensions. The method for color space conversion asillustrated in FIG. 4 is also applied to an HDMI receiver.

Alternatively, Steps 43 to 45 are performed according to a lookup table.The lookup table is stored with the first compressed pixel components,the second compressed pixel components associated with uncompressedoriginal pixel components.

While the disclosure has been described in terms of what is presentlyconsidered to be the most practical and preferred embodiments, it is tobe understood that the inventive concept needs not to be limited to theabove embodiments. On the contrary, it is intended to cover variousmodifications and similar arrangements included within the spirit andscope of the appended claims which are to be accorded with the broadestinterpretation so as to encompass all such modifications and similarstructures.

What is claimed is:
 1. A circuit for color space conversion andimplemented at least in part in hardware, comprising: a conversion unitthat performs a linear color space compression by converting a pixelsignal from a first color space to a second color space, the secondcolor space having a plurality of color dimensions, the conversion unitgenerating a plurality of pixel components of the color dimensions forthe pixel signal, and compressing the pixel components to output aplurality of corresponding compressed pixel components when each of thepixel components is within a corresponding compression interval, thecompressed pixel components within a predetermined range of the colordimensions of the second color space, wherein the conversion unitcomprises a lookup table for storing the pixel components and thecorresponding compressed pixel components, wherein the conversion unitcompresses the pixel components according to the lookup table, whereineach pixel component in the corresponding compression interval has alinear relationship with a corresponding compressed pixel component,wherein the first color space is an xvYCC color space, and the secondcolor space is an sRGB color space, wherein each of the correspondingcompression intervals is adjustable according to values stored in theconversion unit, and wherein a first pixel value interval of thecompression intervals represents a first threshold and an upper limitvalue of each pixel component, and wherein the corresponding compressedpixel component of a pixel component is not lower than the firstthreshold and not higher than an upper limit value of the predeterminedrange.
 2. The circuit for color space conversion as claimed in claim 1,wherein the conversion unit outputs the pixel components when the pixelcomponents fall outside the compression intervals.
 3. The circuit forcolor space conversion as claimed in claim 1, wherein the upper limitvalue of the pixel component is greater than the upper limit value ofthe predetermined range.
 4. The circuit for color space conversion asclaimed in claim 1, wherein a second pixel value interval of thecompression intervals represents a second threshold and a lower limitvalue of each pixel component, and wherein the corresponding compressedpixel component of a pixel component is not lower than a lower limitvalue of the predetermined range.
 5. The circuit for color spaceconversion as claimed in claim 4, further comprising: a register unit,coupled to the conversion unit, that stores a first gradient or a secondgradient, wherein the linear relationship is proportional to either thefirst gradient or the second gradient which is different from the firstgradient.
 6. The circuit for color space conversion as claimed in claim1, wherein the conversion unit is a part of a high definition multimediainterface (HDMI) receiver.
 7. A method for color space conversion, themethod comprising: receiving, by a conversion unit of a circuit that isimplemented at least in part in hardware, a pixel signal of a firstcolor space; converting, by the conversion unit of the circuit, thepixel signal from the first color space to a second color space togenerate a plurality of pixel components of color dimensions of thesecond color space; and compressing, by the conversion unit of thecircuit, the pixel components to output a plurality of compressed pixelcomponents when each of the pixel components is within a correspondingcompression interval, the compressed pixel components within apredetermined range of the color dimensions of the second color space,wherein the act of compressing the pixel components comprises looking upa lookup table having stored therein the pixel components and thecompressed pixel components, wherein each pixel component in thecorresponding compression interval has a linear relationship with acorresponding compressed pixel component, wherein the first color spaceis an xvYCC color space, and the second color space is an sRGB colorspace, wherein each of the corresponding compression intervals isadjustable according to values stored in the conversion unit, andwherein a first pixel value interval of the compression intervalsrepresents a first threshold and an upper limit value of each pixelcomponent, and wherein the upper limit value of each pixel component isgreater than an upper limit value of the predetermined range and notlower than the first threshold.
 8. The method for color space conversionas claimed in claim 7, further comprising: outputting the pixelcomponents when the pixel components fall outside the compressionintervals.
 9. The method for color space conversion as claimed in claim7, wherein at least one compressed pixel component is determinedaccording to the corresponding pixel component, the first threshold anda first gradient, and wherein the linear relationship is proportional tothe first gradient.
 10. The method for color space conversion as claimedin claim 7, wherein a second pixel value interval of the compressionintervals represents a second threshold and a lower limit value of eachpixel component.
 11. The method for color space conversion as claimed inclaim 10, wherein the lower limit value of each pixel component issmaller than a lower limit value of the predetermined range.